<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
session_start();
// [ 应用入口文件 ]
//$ip[]='218.88.29.89';
//$ip[]='140.206.57.164';
//$ip[]='101.95.129.116';
//$ip[]='118.116.109.97';
//if(!in_array($_SERVER['REMOTE_ADDR'],$ip)){
//    include('optimize.html');exit;
//}
define('BASE_PATH',str_replace('\\','/',realpath(dirname(dirname(__FILE__).'/')))."/");
define('LOOK_INTO_SORE',29);
if(strpos($_SERVER['HTTP_USER_AGENT'],'Mobile')!==false  && $_SERVER['HTTP_ORIGIN'] != 'http://busy.azaiyun.com'){
    define('APP_PATH', __DIR__ . '/../application/');
    define('WEB_PATH', __DIR__);
    define('BIND_MODULE','wap');
    define('APP_DEBUG', true);
    $a = strpos($_SERVER['REDIRECT_URL'],'/mobile');
    if(strpos($_SERVER['REDIRECT_URL'],'/mobile')===false){
        header('location:/mobile');
        exit;
    }
}else{
//    include('optimize.html');exit;
    // 定义应用目录
    define('APP_PATH', __DIR__ . '/../application/');
    define('WEB_PATH', __DIR__);
    define('BIND_MODULE','index');
    define('APP_DEBUG', true);
}



// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';
